﻿@model GosWeb.Models.Db.Biont
@{
    ViewBag.Title = "建个体";
}

@if (false)
{
    <script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("/Scripts/jquery-1.4.4-vsdoc.js")" type="text/javascript"></script>
}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.js")" type="text/javascript"></script>
<script type="text/javascript">
    $(function () {
        //alert("hello jquery");

    });     
</script>
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>新建个体数据 [ @Html.ActionLink("返回列表", "Index") ]</legend>
        <table>
        <tr>
        <td class="editor-label">
            @Html.LabelFor(model => model.BiontID)
        </td>
        <td class="editor-field" >
            @Html.EditorFor(model => model.BiontID)
            @Html.ValidationMessageFor(model => model.BiontID)<span style="color:Red">请严格按下列规则输入:</span>
            <br />
            内部生产猪编号规则:“窝号-个体编号”。例如窝号为456,窝内个体号为3，则耳缺号栏填入 456-3 ;<br />
外部购入的猪编号规则：为防止编号与内部猪重复，直接用“猪只ID”填入耳缺号栏。 <br />

        </td>        
        </tr>
        <tr>
        <td class="editor-label">
            @Html.LabelFor(model => model.Sex)
        </td>
        <td class="editor-field">
            @Html.DropDownListFor(model => model.Sex,new SelectList(GosWeb.Models.Db.GenderKeyValue.Genders, "GenderId", "Name"))
            @Html.ValidationMessageFor(model => model.Sex)
        </td>        
        </tr>
        <tr>
         <td class="editor-label">
            @Html.LabelFor(model => model.Birthday)
        </td>
        <td class="editor-field">
            @Html.EditorFor(model => model.Birthday)
            @Html.ValidationMessageFor(model => model.Birthday)
        </td>       
        </tr>
        <tr>
         <td class="editor-label">
            @Html.LabelFor(model => model.NestNumber)
        </td>
        <td class="editor-field">
            @Html.EditorFor(model => model.NestNumber)
            @Html.ValidationMessageFor(model => model.NestNumber)
        </td>       
        </tr>
        <tr>  
        <td class="editor-label">
            @Html.LabelFor(model => model.FatherID)
        </td>
        <td class="editor-field">
            @Html.EditorFor(model => model.FatherID)
            @Html.ValidationMessageFor(model => model.FatherID)
            输入父亲的耳缺号
         </td>       
        </tr>
        <tr>
         <td class="editor-label">
            @Html.LabelFor(model => model.MotherID)
        </td>
        <td class="editor-field">
            @Html.EditorFor(model => model.MotherID)
            @Html.ValidationMessageFor(model => model.MotherID)
            输入母亲的耳缺号
        </td>       
        </tr>
 
        <tr>
         <td class="editor-label">
            @Html.LabelFor(model => model.FromTo)
        </td>
        <td class="editor-field">
            @Html.DropDownListFor(model => model.FromTo, new SelectList(GosWeb.Models.Db.FromToValue.FromToes, "Id", "Name"))
            @Html.ValidationMessageFor(model => model.FromTo)
        </td>       
        </tr> 
        <tr>
        <td class="editor-label">
            @Html.LabelFor(model => model.Address.Site)
        </td>
        <td class="editor-field">
            @Html.DropDownListFor(model => model.Address.Site, new SelectList(GosWeb.Biz.BiontBiz.GetInstance().GetSites(), "Code", "Value"))
            @Html.ValidationMessageFor(model => model.Address.Site)
        </td>        
        </tr>  
 
        <tr>
         <td class="editor-label">
            @Html.LabelFor(model => model.LeftTitNumber)
        </td>
        <td class="editor-field">
            @Html.EditorFor(model => model.LeftTitNumber)
            @Html.ValidationMessageFor(model => model.LeftTitNumber)
        </td>       
        </tr> 
        <tr>
        <td class="editor-label">
            @Html.LabelFor(model => model.RightTitNumber)
        </td>
        <td class="editor-field">
            @Html.EditorFor(model => model.RightTitNumber)
            @Html.ValidationMessageFor(model => model.RightTitNumber)
        </td>        
        </tr>  
        <tr>
        <td class="editor-label">
            @Html.LabelFor(model => model.Weight)
        </td>
        <td class="editor-field">
            @Html.EditorFor(model => model.Weight)
            @Html.ValidationMessageFor(model => model.Weight)
        </td>        
        </tr>
        <tr>
         <td class="editor-label">
            @Html.LabelFor(model => model.PrivInfo)
        </td>
        <td class="editor-field">
            @Html.TextAreaFor(model => model.PrivInfo)
            @Html.ValidationMessageFor(model => model.PrivInfo)
        </td>       
        </tr> 
        <tr>
         <td class="editor-label">
            @Html.LabelFor(model => model.PubInfo)
        </td>
        <td class="editor-field">
            @Html.TextAreaFor(model => model.PubInfo)
            @Html.ValidationMessageFor(model => model.PubInfo)
        </td>       
        </tr> 
        </table>
        <p>
            <input type="submit" value="下一步>" />
        </p>
    </fieldset>
}
<br />
<b>说明</b><br />
<b>ID号：</b><br />
将自动编号为:"猪种代码-猪场代码-耳号"。如"LD-XS-00001-04"，"LD"是品名，表示"长白杜洛克";
XS是猪场代号："雪山猪场";"00001-04"是耳缺号）

